package com.ruoyi.zhjd.laboratory.modules.tensionRecording.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;


import com.ruoyi.zhjd.laboratory.modules.tensionRecording.entity.TensionRecording;
import com.ruoyi.zhjd.laboratory.modules.tensionRecording.mapper.LTensionRecordingMapper;
import com.ruoyi.zhjd.laboratory.modules.tensionRecording.service.LTensionRecordingService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 张拉记录(TensionRecording)表服务实现类
 *
 * @author makejava
 * @since 2023-07-12 13:36:33
 */
@Service("tensionRecordingService")
@AllArgsConstructor
public class LTensionRecordingServiceImpl extends ServiceImpl<LTensionRecordingMapper, TensionRecording> implements LTensionRecordingService {

//    @Autowired
//    private BaseServiceComponent baseServiceComponent;

    @Override
    public IPage<TensionRecording> page(Map<String, Object> params) {
//        IPage<TensionRecording> page = baseServiceComponent.getPage(params, TensionRecording.class);
        return baseMapper.query(null, params);
    }

    /**
     * 查询
     *
     * @param id
     * @return
     */
    @Override
    public TensionRecording getInfoById(String id) {
        return getById(id);
    }

    /**
     * 新增
     *
     * @param tensionRecording
     * @return
     */
    @Override
    public void insertTensionRecording(TensionRecording tensionRecording) {
        tensionRecording.setId(IdWorker.get32UUID());
        //创建者
//        tensionRecording.setCreateBy(SecurityUser.getUserId());
        //创建时间
//        tensionRecording.setCreateTime(DateUtils.getDate("yyyy-MM-dd HH:mm:ss"));
        save(tensionRecording);
    }

    /**
     * 修改
     *
     * @param tensionRecording
     */
    @Override
    public void updateTensionRecordingById(TensionRecording tensionRecording) {
        //修改者
//        tensionRecording.setUpdateBy(SecurityUser.getUserId());
        //修改时间
//        tensionRecording.setUpdateTime(DateUtils.getDate("yyyy-MM-dd HH:mm:ss"));
        updateById(tensionRecording);
    }

    /**
     * 删除 批量/单个
     *
     * @param ids
     */
    @Override
    public void deleteByIds(List<String> ids) {
        removeByIds(ids);
    }
}

